#!/bin/sh
#
# Copyright 2018, Data61, CSIRO (ABN 41 687 119 230)
#
# SPDX-License-Identifier: GPL-2.0-only
#

WAIT=event_wait
READ=dataport_read
WRITE=dataport_write

EV1_NAME=/dev/ev1
EV2_NAME=/dev/ev2

DP1_NAME=/dev/dp1
DP2_NAME=/dev/dp2

LARGE_FILE=/opt/text/lipsum

echo "Waiting on $EV1_NAME"
cat $LARGE_FILE | $WRITE $DP2_NAME &

$WAIT $EV1_NAME
echo "Back from waiting on $EV1_NAME"
echo -n "Received message: "
$READ $DP1_NAME
